#ifndef MYENV_H
#define MYENV_H

/**
 * Set an environment variable.
 * If overwrite is 0, the variable will not be overwritten if it already exists.
 * If overwrite is 1, the variable will be overwritten if it already exists.
 * If the variable is already set, the function will return 0.
 * If the variable is not set, the function will return -1.
 * 
 * @param name the name of the variable to set.
 * @param value the value of the variable to set.
 * @param overwrite whether to overwrite the variable if it already exists.
 * @return 0 if the variable is set, -1 if the variable is not set, and errno is set to the error code.
 * @error EINVAL if the name is NULL or length is 0 or contains '='.
 * @error ENOMEM if the memory allocation fails.
 * @error EPERM if the user is not allowed to set the variable.
 * @error ENOENT if the variable is not set.
 * @error ENOENT if the variable is not set.
 */
int mysetenv(const char *name, const char *value, int overwrite);

/**
 * Unset an environment variable.
 * If the variable is not set, the function will return 0.
 * If the variable is set, the function will return -1.
 * 
 * @param name the name of the variable to unset.
 * @return 0 if the variable is unset, -1 if the variable is not set, and errno is set to the error code.
 * @error EINVAL if the name is NULL or length is 0 or contains '='.
 */
int myunsetenv(const char *name);

#endif